/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.kmagsoft.jconvert.utils;

import gr.anagnosg.general.utils.Parser;
import java.util.List;
import org.im4java.core.IMOperation;

/**
 *
 * @author anagnosg
 */
public class IMCommUtils {
    IMOperation imoper = new IMOperation ();
    
    public  void addOptionCommand(String action , String paramSelect, String paramInserted, String manualOption){
        if(paramSelect.equals("") && paramInserted.equals("")){//manual option TODO.
            
        }
        else if(paramSelect.equals("")){ //insert option
        
        }
        else{//select option. 
            
            if(paramSelect.equals(gr.anagnosg.image.imagemagick.Constants.RESIZE_STR)){
             Integer width=null;
             Integer height=null;
             //break params.
             //resize_3=50% resize_4=800x600\!
             //has x
             if(paramSelect.indexOf("x")>0){
                 List numbers = Parser.findNums(paramSelect);
                 if(numbers!=null && numbers.size()>0){width = (Integer)numbers.get(0);}
                 if(numbers!=null && numbers.size()>0){height = (Integer)numbers.get(1);}
             }   
                
             //imoper.resize(Integer.SIZE, Integer.SIZE, action);
            }
        }
    
    }
    
}
